package org.jackysoft.hibernate;

import java.io.Serializable;

import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;
import org.jackysoft.util.ClassUtils;

public class AcegiRoleIdGenerator implements IdentifierGenerator {

	@Override
	public Serializable generate(SessionImplementor session, Object object)
			throws HibernateException {
		String name = "ROLE_".concat(ClassUtils.randomString().toUpperCase());
		return name;
	}

}
